home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_cyn_watersplash.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  86 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_WaterSplash.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     timer
  14.     
  15.     thing       origin          # Where the bubbles are coming from
  16.     thing       wave            local
  17.     thing       player          local
  18.     
  19.     
  20.     template    splash0=+ripples2     local
  21.     template    splash1=+ripples      local
  22.     template    splash2=+ripples      local
  23.     
  24.     vector      vecPos          local
  25.     vector      startWave       local
  26.     vector      finWave         local
  27.     
  28.     int         i=0             local
  29.     int            waves=5            local
  30.     int         randNum         local
  31.     int         splashing=0     local
  32.     
  33.     flex        fin_XY          local
  34.     
  35. end
  36.  
  37. # ========================================================================================
  38.  
  39. code
  40.  
  41. startup:
  42.  
  43.     Print("splashing on");
  44.     splashing = 1;
  45.     SetTimer(0.5);
  46.  
  47. return;
  48.  
  49.  
  50. # ========================================================================================
  51. # ========================================================================================
  52.  
  53. timer:
  54.  
  55.     vecPos = VectorSet(rand()*0.15, rand()*0.15, 0);
  56.     
  57.     # randomize finish size
  58.     randNum = RandBetween(1, 3);
  59.     if(randNum == 1) fin_XY = 0.1;
  60.     else if(randNum == 2) fin_XY = 0.3;
  61.     else if(randNum == 3) fin_XY = -0.05;
  62.     
  63.     for(i=0; i<waves; i=i+1)                                                                        
  64.     {                                                                                                    
  65.         wave = CreateThingAtPos(splash0[RandBetween(0, 2)], GetThingSector(origin), VectorAdd(GetThingPos(origin), VectorAdd('-0.025 -0.035 0.0', vecPos)), '0 0 0');
  66.         CaptureThing(wave);
  67.         
  68.         startWave = VectorSet(0.01, 0.01, 1.0);
  69.         finWave = VectorSet(0.3+fin_XY, 0.3+fin_XY, 0.0); # 0.15
  70.         AnimateSpriteSize(wave, startWave, finWave, 1.3);
  71.     }
  72.     
  73.     
  74.     if(i == 5)
  75.     {
  76.         i = 0;
  77.         SetTimer(0.5);
  78.     }
  79.     
  80.     return;   
  81.     
  82. # ========================================================================================
  83.  
  84. end
  85.  
  86.